import { PlanetUtils } from "../utils/PlanetUtils";
import type { PlanetProduct } from "./PlanetProduct";
import type { PlayerPlanet } from "./PlayerPlanet";

/**
 * 行星统计
 *
 * 反应整个行星当前的采集加工状态
 */
export class PlanetStatistics {
  /**
   * 产出的原始资源统计信息
   */
  primitiveResource: PlanetProduct[];
  planet: PlayerPlanet;
  constructor(planet: PlayerPlanet) {
    this.primitiveResource = planet.basicResource;
    this.planet = planet;
  }
  get totalInputStatistics() {
    return PlanetUtils.getTotalInputStatistics(this.planet.factories, this.primitiveResource);
  }

  get totalOutputStatistics() {
    return PlanetUtils.getTotalOutputStatistics(this.planet.factories);
  }
}
